package com.cms.server.tool;
import java.util.Date;
import java.text.SimpleDateFormat;
public class Timestamp {
    public static long now_time(){
        Date now = new Date();
        return now.getTime(); // 返回时间戳
    }

    public static String stamp_to_data(long timestamp){
        // 将时间戳转换为日期格式
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(new Date(timestamp));
    }


}
